﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace msBsc.WebUi.mMall.Public
{
    public partial class mfAccountVerify : msBsc.Cls.mbPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public override void DoAction()
        {
            if (this.strAction == "doVerify")
            {
                string stremkey = this.GetParamHtValue("KEY");
                if (stremkey != string.Empty)
                {
                    if (stremkey == string.Empty)
                    {
                        return;
                    }
                    stremkey = msBsc.AppLogic.Cfg.DesCry.uncMe(stremkey, "rmdes");
                    string[] arrten = stremkey.Split(',');
                    if (arrten.Length < 3)
                    {
                        //this.ExecJScript("window.location.href = '/c_RegMailSend.htm';");提示错误链接失效
                        return;
                    }
                    using (msBsc.AppLogic.DataAlc.CBizCustomerRegister register = new AppLogic.DataAlc.CBizCustomerRegister())
                    {
                        string[] retArry = register.UserActivation(arrten[0], arrten[4]);
                        if (retArry[0] != "TRUE")
                        {
                            this.ExecJScript(@"ValidationFails('"+retArry[1]+"')");
                            return;
                        }
                    }
                    string ret = msBsc.SvRef.UserInfo.LoginCustomer(arrten[0], arrten[1]);
                    if (ret != "OK")
                    {
                        //this.SetContrlValue("login_notice", ret);提示错误
                    }
                    else
                    {
                        string url = "/m/mp_Index.htm";
                        this.ExecJScript(@"$('#AccountNumber').text('" + msBsc.SvRef.UserInfo.OperatorName + "');TimeDown('" + url + "')");
                        //this.ExecJScript("window.location.href = '/wb_TouristInfo.htm?djackId="+msBsc.SvRef.UserInfo.Operator+"';");

                        //this.ExecJScript(@"setCookie('" + account + "','" + password + "');susccLogin()");
                    }

                }
            }
        }
    }
}